using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Data.OleDb;
using System.Collections.Generic;
using Model;


namespace Db.DAL
{
    public class Command
    {
        public Model.Commond GetDataByID()
        {
            Model.Commond cd = null;
            string sqlText = "SELECT [CMD] "
                           + "FROM [Command] ";
            OleDbDataReader oleDbDataReader = SqlHelper2.ExecuteReader(sqlText, null);
            if (oleDbDataReader != null)
            {
                if (oleDbDataReader.Read())
                {
                    cd = new Model.Commond();
                    ReadUsersAllData(oleDbDataReader, cd);
                }
                oleDbDataReader.Close();
            }
            return cd;
        }

        protected void ReadUsersAllData(IDataReader dataReader, Model.Commond cd)
        {
            // ID
            if (dataReader["CMD"] != DBNull.Value)
                cd.CMD = Convert.ToInt32(dataReader["CMD"]);

    
        }
    }
}
